/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import entities.Feedback;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import entities.*;
import java.util.*;
import javax.persistence.*;

/**
 *
 * @author xuanthuy
 */
@Stateless
public class FeedbackFacade extends AbstractFacade<Feedback> {
    @PersistenceContext(unitName = "AlluringDecorsPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public FeedbackFacade() {
        super(Feedback.class);
    }
    
    // select all
    public List<Feedback> truyvanAll() {
        try {
            Query q = this.em.createQuery("select fb FROM Feedback fb");
            return q.getResultList();
        } catch (Exception e) {
            return null;
        }
    }
}
